﻿package net.wangit.framework.config;

import net.wangit.jdbc.DBImplementor;
import net.wangit.jdbc.Table;
import net.wangit.view.unit.UnitComponent;

import org.apache.commons.logging.Log;


public class DebugSettings {

	public DebugSettings() {
	}

	public static boolean isDebugEnabled(Log log, DBImplementor db) {
		return log.isDebugEnabled() && db.getJDBCSettings().isDebugEnabled();
	}

	public static boolean isDebugEnabled(Log log, String domain) {
		return log.isDebugEnabled() && !Domains.isSystemDomain(domain);
	}

	public static boolean isDebugEnabled(Log log, UnitComponent uc) {
		return isDebugEnabled(log, uc.getDomain());
	}

	public static boolean isDebugEnabled(Log log, Table table) {
		return isDebugEnabled(log, table.getDomain());
	}
}
